import { RouteRecordRaw } from 'vue-router'
import Layout from '@/components/ScreenLayout/ScreenLayout.vue'
import SystemLayout from '@/components/SystemLayout/SystemLayout.vue' // 后台模板
import MenuLayout from '@/components/MenuLayout/MenuLayout.vue'
/* 需要权限的路由 */
const dynamicRoutes: RouteRecordRaw[] = [
  {
    path: '',
    redirect: 'DigitalizeCountry',
    meta: {
      title: '智慧大屏'
    },
    component: Layout,
    children: [
      {
        path: '/DigitalizeCountry',
        name: 'DigitalizeCountry',
        meta: {
          title: '智慧数字乡村'
        },
        component: () =>
          import('@/views/dynamic/DigitalizeCountry/DigitalizeCountry.vue')
      },
      {
        path: '/ConstructionParty',
        name: 'ConstructionParty',
        meta: {
          title: '智慧党务建设'
        },
        component: () =>
          import('@/views/dynamic/ConstructionParty/ConstructionParty.vue')
      },
      {
        path: '/System',
        name: 'System',
        meta: {
          title: '系统后台'
        },
        redirect: 'organization',
        component: SystemLayout,
        children: [
          {
            path: '/organization',
            name: 'organization',
            redirect: 'party',
            meta: {
              title: '组织管理',
              icon: 'icon-system-sidaber-menu-zuzhi'
            },
            component: MenuLayout,
            children: [
              {
                path: '/party',
                name: 'party',
                meta: {
                  title: '党组织管理'
                },
                component: () =>
                  import('@/views/dynamic/system/organization/party/party.vue')
              },
              {
                path: '/team',
                name: 'team',
                meta: {
                  title: '班子管理'
                },
                component: () =>
                  import('@/views/dynamic/system/organization/team/team.vue')
              }
            ]
          },
          {
            path: '/village',
            name: 'village',
            redirect: 'structure',
            meta: {
              title: '智慧村务',
              icon: 'icon-system-sidaber-menu-cunwu'
            },
            component: MenuLayout,
            children: [
              {
                path: '/structure',
                name: 'structure',
                meta: {
                  title: '组织架构'
                },
                component: () =>
                  import(
                    '@/views/dynamic/system/village/structure/structure.vue'
                  )
              },
              {
                path: '/notice',
                name: 'notice',
                meta: {
                  title: '通知公告'
                },
                component: () =>
                  import('@/views/dynamic/system/village/notice/notice.vue')
              },
              {
                path: '/revitalization',
                name: 'revitalization',
                meta: {
                  title: '乡村振兴'
                },
                component: () =>
                  import(
                    '@/views/dynamic/system/village/revitalization/revitalization.vue'
                  )
              }
            ]
          },
          {
            path: '/role',
            name: 'role',
            meta: {
              title: '角色管理',
              icon: 'icon-system-sidaber-menu-jueseguanli'
            },
            component: () => import('@/views/dynamic/system/role/role.vue')
          },
          {
            path: '/user',
            name: 'user',
            meta: {
              title: '用户管理',
              icon: 'icon-system-sidaber-menu-yonghuguanli'
            },
            component: () => import('@/views/dynamic/system/user/user.vue')
          },
          {
            name: 'dataWarehouse',
            path: '/dataWarehouse',
            meta: {
              title: '数据仓库',
              icon: 'icon-system-sidaber-menu-cangku'
            },
            redirect: 'dataWarehouse',
            component: MenuLayout,
            children: [
              {
                path: '/dataWarehouse',
                name: 'dataWarehouse',
                meta: {
                  title: '数字乡村'
                },
                component: () =>
                  import(
                    '@/views/dynamic/system/dataWarehouse/countryData/countryData.vue'
                  )
              },
              {
                path: '/partyData',
                name: 'partyData',
                meta: {
                  title: '智慧党务'
                },
                component: () =>
                  import(
                    '@/views/dynamic/system/dataWarehouse/partyData/partyData.vue'
                  )
              }
            ]
          }
        ]
      }
    ]
  }
]

export default dynamicRoutes
